//*********************************************************************
// Copyright (C) 2014 Hell Prototypes / www.hellprototypes.com
// 
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or (at
// your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
//********************************************************************
#include <avr/io.h>
#include "common.h"

void PCF8563_init()
{

}

// Get time
void PCF8563_get(s_time* timeData)
{
	rtc_read(PCF8563ADDR_SECS, (byte*)timeData, sizeof(s_time));

	//Mask unused bits
	timeData->secs  = timeData->secs & 0x7f;
	timeData->mins  = timeData->mins & 0x7f;
	timeData->hours = timeData->hours& 0x3f;
	timeData->date  = timeData->date & 0x3f;
	timeData->day   = timeData->day  & 0x07;
	timeData->month = timeData->month& 0x1f;
	//timeData->year  = timeData->year;
}

